<!DOCTYPE html>
<html  lang="en">
<head>
    <meta charset="utf-8" />
    <title>表单实例2</title>
</head>
<body>
<center>
    <form action="" target="_blank" method="get">
        <table border="0" cellspacing="" cellpadding="">
            <tr>
                <td><label for="firstname">名字:</label></td>
                <td><input type="text" name="firstname" id="firstname" required="required" value="" /></td>
            </tr>
            <tr>
                <td><label for="lastname">姓氏:</label></td>
                <td><input type="text" name="lastname" id="lastname" required="required" value="" /></td>
            </tr>
            <tr>
                <td><label for="login name">登录名:</label></td>
                <td><input type="text" name="login name" required="required" pattern="^\w{4,8}$" id="login name" value="" />（可包含a-z、0-9和下划线）</td>
            </tr>
            <tr>
                <td><label for="password">密码:</label></td>
                <td><input type="password" name="password" required="required" pattern="^[a-zA-Z]\w{5,17}$" id="password" value="" />（至少包含6个字符）</td>
            </tr>
            <tr>
                <td><label for="password2">再次输入密码:</label></td>
                <td><input type="password" name="password2" required="required" pattern="^[a-zA-Z]\w{5,17}$" id="password2" value="" /></td>
            </tr>
            <tr>
                <td><label for="myEmail">电子邮箱:</label></td>
                <td><input type="email" name="myEmail" id="myEmail" value="" />（必须包含@字符）</td>
            </tr>
            <tr>
                <td><label>性别:</label></td>
                <td>
                    <input type="radio" name="sex"  value="male" />男
                    <input type="radio" name="sex"  value="female" />女
                </td>
            </tr>
            <tr>
                <td><label>头像:</label></td>
                <td><input type="file" name="myFile" /></td>
            </tr>
            <tr>
                <td><label>爱好:</label></td>
                <td>
                    <input type="checkbox" name="hobby"  value="运动" />运动
                    <input type="checkbox" name="hobby"  value="聊天" />聊天
                    <input type="checkbox" name="hobby"  value="玩游戏" />玩游戏
                </td>
            </tr>
            <tr>
                <td><label>出生日期:</label></td>
                <td>
                    <input type="text" size="1" name="year"placeholder="yyyy" id="" value="" />年
                    <select name="month">
                        <option value ="0">[选择月份]</option>
                        <option value ="1">1月</option>
                        <option value ="2">2月</option>
                        <option value ="3">3月</option>
                        <option value ="4">4月</option>
                        <option value ="5">5月</option>
                        <option value ="6">6月</option>
                        <option value ="7">7月</option>
                        <option value ="8">8月</option>
                        <option value ="9">9月</option>
                        <option value ="10">10月</option>
                        <option value ="11">11月</option>
                        <option value ="12">12月</option>
                    </select>
                    <input type="text" size="1" name="day" placeholder="dd"/>日
                </td>
            </tr>
        </table>
        <input type="button"  value="提交" />
        <input type="button"  onclick="reset();return false;" value="重填" />
    </form>
</center>
</body>
</html>

